.\"   $Id: loadlofig.3,v 1.1 2002/03/08 13:51:02 fred Exp $
.\" @(#)loadlofig.2 2.11 91/08/22 ; Labo masi cao-vlsi; Author : Frederic Petrot
.if t \{\
.so man1/alc_contents.mac
.XS \n%
.ti 0.2i
loadlofig
.XE
.XS3 \n%
.ti 0.2i
loadlofig
.XE3 \}
.TH LOADLOFIG 3 "October 1, 1997" "ASIM/LIP6" "MBK LOGICAL UTILITY FUNCTIONS"
.SH NAME
loadlofig \- load a new logical cell model from disk 
.so man1/alc_origin.1
.SH SYNOPSIS
.nf
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
#include "mlo.h"
void loadlofig(ptfig, figname, mode)
lofig_list \(**ptfig;
char \(**figname;
char mode;
.ft R
.fi
.SH PARAMETERS
.TP 20
\fIptfig\fP
Pointer to an allocated but empty \fIlofig\fP
.TP
\fIfigname\fP
Name of the figure to be loaded
.TP
\fImode\fP
Loading mode
.SH DESCRIPTION
\fBloadlofig\fP fills the \fIlofig\fP pointed to by \fIptfig\fP with the 
contents of a disk file called \fIfigname\fP. The loading mode may be either
\fB'A'\fP, then the entire content is parsed, or \fB'P'\fP then only
connectors and extrernal signals are loaded in memory, or \fB'C'\fP, that
loads the "complement" of an already partially loaded cell in order to
keep the same pointer when accessing the same file.
.br
The \fBloadlofig\fP(3) function in fact performs a call to a parser, chosen
by the \fBMBK_IN_LO\fP(1) environment variable. The directories searched for the
file are first the one sets by \fBMBK_WORK_LIB\fP(1) and then, in the described
order, the ones set by \fBMBK_CATA_LIB\fP(1).
See \fBMBK_IN_LO\fP(1), \fBMBK_WORK_LIB\fP(1), \fBMBK_CATA_LIB\fP(1) and
\fBmbkenv\fP(3) for details.
.SH ERRORS
Some errors resulting from a call to \fBloadlofig\fP are due to the parsers,
and are prefixed by the parser format (pf). 
.br
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
"\(**\(**\(** mbk error \(**\(**\(** not supported logical input format 'xxx'"
.ft R
.RS
The environment variable \fBMBK_IN_LO\fP is not set to a legal logical
format.
.RE
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
"\(**\(**\(** mbk error \(**\(**\(** pfloadlofig : could not open file \fIfigname\fP"
.ft R
.RS
No file called \fIfigname.ext\fP, where \fIext\fP is the file format extension,
has been found in the directories set by the environment.
.RE
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
"\(**\(**\(** mbk error \(**\(**\(** pfloadlofig : syntax error line x parsing \fIfigname.ext\fP"
.ft R
.RS
Either the file has been corrupted and its syntax is not legal, or there is a
bug in the given parser.
.RE
.SH EXAMPLE
.ta 3n 6n 9n 12n 15n 18n 21n
.nf
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
#include "mlo.h"
lofig_list \(**get_the_lofig(figname, mode)
char \(**figname;
char mode;
{
lofig_list \(**pt;
	for (pt = HEAD_LOFIG; pt; pt = pt\->NEXT) /\(** scan figure list \(**/
		if (!strcmp(pt\->NAME, figname))
			break;
	if (!pt) { /\(** figure doesn't exist \(**/
		pt = addlofig(figname);
		pt\->MODE = mode == 'A' ? mode : 'P';
		loadlofig(pt, figname, pt\->MODE);
		return pt;
	}
	if (ptfig\->MODE != 'A') { /\(** figure exists interface only \(**/
		if (mode == 'A') {
			pt\->MODE = 'A';
			loadlofig(pt, figname, 'C');
			return pt;
		} else
			return pt;
	} else /\(** figure exists interface and body \(**/
		return pt;
}
.ft R
.fi
.SH SEE ALSO
.BR mbk (1),
.BR mbkenv (3),
.BR lofig (3),
.BR addlofig (3),
.BR getlofig (3),
.BR dellofig (3),
.BR savelofig (3),
.BR flattenlofig (3),
.BR rflattenlofig (3),
.BR MBK_IN_LO (1),
.BR MBK_WORK_LIB (1),
.BR MBK_CATA_LIB (1).


.so man1/alc_bug_report.1

